#include  "ShareMemorey.hpp"
#include "Time.hpp"
#include "Fifo.hpp"
int main()
{
   shm.CreatShm();
   shm.Shmattch();

    // char* shmbuffer = (char*)shm.Getaddr();

    // while(1)
    // {
    //     printf("%s\n",shmbuffer);
    //     sleep(1);
    // }

    fifo.OpenForRead();

    //获取数据
    struct Data* shmdata = (struct Data*)shm.Getaddr();
    while (true)
    {
        fifo.wait();
        printf("status: %s\n", shmdata->status);
        printf("lasttime: %s\n", shmdata->lasttime);
        printf("image: %s\n", shmdata->image);
        strcpy(shmdata->status, "过期");
        sleep(1);
    }
  
   shm.Shmdeattch();

   sleep(5);
   shm.Shmdelete();

    return 0;
}